<?php
/**
 * 
 * ClientEngage: ClientEngage Visitor Voice (http://www.clientengage.com)
 * Copyright 2012, ClientEngage (http://www.clientengage.com)
 *
 * You must have purchased a valid license from CodeCanyon in order to have 
 * the permission to use this file.
 * 
 * You may only use this file according to the respective licensing terms 
 * you agreed to when purchasing this item on CodeCanyon.
 * 
 * 
 * 
 *
 * @author          ClientEngage <contact@clientengage.com>
 * @copyright       Copyright 2013, ClientEngage (http://www.clientengage.com)
 * @link            http://www.clientengage.com ClientEngage
 * @since           ClientEngage - Visitor Voice v 1.0
 * 
 */
?>
<div class="settings row">
    <div class="settings span12">
        <?php echo $this->Form->create('Setting'); ?>	<fieldset>
            <legend><?php echo __('Edit Settings'); ?></legend>
            <?php
            echo $this->Form->input('System-language', array('label' => __('System Language'), 'type' => 'select', 'options' => AppLanguages::getAll()));
            echo $this->Form->timezone('System-timezone', array('label' => __('System Timezone')));
            if (false)
            {
                $this->Html->scriptBlock('
              $(function() {

                if($(".select-transport").val() == "mail")
                    $(".smtp-settings").hide();

                $(".select-transport").change(function() {
                    if($(this).val() == "mail")
                        $(".smtp-settings").fadeOut();
                    else
                        $(".smtp-settings").fadeIn();
                });
              });
              ', array('inline' => false));

                echo '<h3 class="controls">' . __('Email Settings') . '</h3>';
                echo $this->Form->input('Email-email', array('label' => __('Sender Email')));
                echo $this->Form->input('Email-sender', array('label' => __('Sender Name')));
                echo $this->Form->input('Email-transport', array('label' => __('Transport Method'), 'type' => 'select', 'options' => array('mail' => __('PHP mail() function'), 'smtp' => __('SMTP account')), 'class' => 'select-transport'));

                echo '<div class="well smtp-settings"><h3 class="controls">' . __('SMTP Settings') . '</h3>';
                echo '<p class="controls" style="width: 450px; font-size: 11px;">' . __('Please enter your SMTP details below. For example, for GMail you need to use the following data: ssl://smtp.gmail.com (host), 465 (port), your.name@gmail.com (username) and your password. After sending the test-email it is <strong>important</strong> that you save your changes by clicking "Save Configuration" below.') . '</p>';
                echo $this->Form->input('Email-host', array('label' => __('Host')));
                echo $this->Form->input('Email-port', array('label' => __('Port')));
                echo $this->Form->input('Email-username', array('label' => __('Username')));
                echo $this->Form->input('Email-password', array('label' => __('Password'), 'type' => 'password'));
                echo $this->Form->input('test-email', array('name' => 'test-email', 'label' => __('Test-Email'), 'class' => 'input-medium', 'after' => $this->Form->button(__('Send Test-Email'), array('name' => 'btn_test-email', 'class' => 'btn btn-mini'))));
                echo '</div>';
            }
            ?>
            <div class="form-actions">
                <?php echo $this->Form->submit(__('Submit'), array('class' => 'btn btn-primary blockinterface', 'div' => false)); ?>
            </div>
        </fieldset>
        <?php echo $this->Form->end(); ?>
    </div>
</div>



